/*

Author   : chaos

FileName : ptr_fun.cpp

Date     : 10/08/17 00:28:23

*/
#include <iostream>
using namespace std;

void prn1(void){cout << "Function prn1." << endl;}

void prn2(void){cout << "Function prn2." << endl;}

void prn_d(int i){
    cout << "Function prn_d. int=" << i << endl;
}
int main(int argc ,char *argv[])
{

    cout << "The address of function prn_d is " << prn_d << "." << endl;

    void (*ptr_fun)(void);
    void (*ptr_fun1)(int);

    ptr_fun=prn1;
    ptr_fun();

    ptr_fun=prn2;
    ptr_fun();

    ptr_fun1 = prn_d;
    ptr_fun1(5);

    return 0;
}
